<script setup lang="ts">
import { EnumOpType } from "@renderer/assets/types";
import {ref} from 'vue'
import BtnWithDropdown from "@renderer/view/components/components/BtnWithDropdown.vue";
import { useUserOpStore } from "@renderer/store/pinia/userOp";
import { getActiveTabViewOp } from "@renderer/view/hooks/common";

const {
  activeViewRef: activeView
} = getActiveTabViewOp()
const screenShotMenus = [
  {
    label: '保存为图片',
    value: 'savePng'
  },
  {
    label: '保存为Dicom',
    value: 'saveDicom'
  },
];

const screenShotRef = ref({
    savePng: false,
    saveDicom: false
  })


const userOp = useUserOpStore()
const handleClick = () => {
   setTimeout(() =>  {
     userOp.setDefaultActiveOp(activeView.value.viewId)
   }, 500)
}
</script>

<template>
  <btn-with-dropdown
    :disabled="true"
    tips="截图保存"
    :op-type="{
      type: EnumOpType.screenshot,
      subType: ''
    }"
    @btn-click="handleClick"
    icon="mdi-monitor-screenshot">
    <template #dropdownSlot>
      <v-card >
        <v-card-text>
          <template  v-for="item in screenShotMenus">
            <v-checkbox
              density="compact"
              :hide-details="true"
              v-model="screenShotRef[item.value]"
              :label="item.label"
            >
            </v-checkbox>
          </template>

        </v-card-text>
      </v-card>
    </template>
  </btn-with-dropdown>
</template>

<style scoped>

</style>
